<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 多级对象的解构
        const pig = {
            name: '佩奇',
            family: {
                mother: '猪妈妈',
                father: '猪爸爸',
                sister: '乔治'
            },
            age: 6
        }
        const { name, family: { mother, father, sister }, age } = pig
        console.log(name, mother, father, sister, age)

        // 每当有一个冒号出现，冒号的左边就是查找对应的位置，冒号的右边就是赋值的目标
    </script>
</body>

</html>